/**
 * 办件统计的api接口
 */
import request from "@/utils/request";

/**
 * 按照区域分组统计办件量
 * @param {*} params
 * @returns
 */
export function caseStatisticCharts(params) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/zcbl/caseStatistic/caseStatisticCharts",
    method: "get",
    params: params
  });
}

/**
 * 查询某一个区划下办件量，按照月份分组
 * @param {*} params
 * @returns
 */
export function caseStatisticChartsByMonthGroup(params) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/zcbl/caseStatistic/caseStatisticChartsByMonthGroup",
    method: "get",
    params: params
  });
}

export function caseStatisticChartsByApplyUserTypeGroup(params) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/zcbl/caseStatistic/caseStatisticChartsByApplyUserTypeGroup",
    method: "get",
    params: params
  });
}

export function caseStatisticChartsByCaseStatusGroup(params) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/zcbl/caseStatistic/caseStatisticChartsByCaseStatusGroup",
    method: "get",
    params: params
  });
}

/**
 * 统计清单的办件时长和视频辅助的次数
 * @param {*} params
 * @returns
 */
export function detailListStatisticByHdlOidGroup(params) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/zcbl/caseStatistic/detailListStatisticByHdlOidGroup",
    method: "get",
    params: params
  });
}

/**
 * 导出区域办件统计数据
 * @param {*} startDate
 * @param {*} endDate
 * @returns
 */
export function exportExcelCaseStatistic(startDate = "", endDate = "") {
  return (
    process.env.VUE_APP_BASE_API +
    process.env.VUE_APP_KSTB_ROUTE_PATH +
    `/zcbl/caseStatistic/exportExcelCaseStatistic?startDate=${startDate}&endDate=${endDate}`
  );
}

export function exortExcelDetailListStatistic(
  listName = "",
  startDate = "",
  endDate = ""
) {
  return (
    process.env.VUE_APP_BASE_API +
    process.env.VUE_APP_KSTB_ROUTE_PATH +
    `/zcbl/caseStatistic/exortExcelDetailListStatistic?startDate=${startDate}&endDate=${endDate}&listName=${listName}`
  );
}
